home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2107 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: news01.aud.alcatel.com!usenet
  2. From: hudssp@aud.alcatel.com (Stanford Hudson)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: printf-problem
  5. Date: 19 Jan 1996 05:17:10 GMT
  6. Organization: Alcatel Network Systems
  7. Message-ID: <4dn9gm$adc@news01.aud.alcatel.com>
  8. References: <4dj4g6$t9f@sunsystem5.informatik.tu-muenchen.de>
  9. Reply-To: hudssp@aud.alcatel.com
  10. NNTP-Posting-Host: mosquito.aud.alcatel.com
  11.  
  12.  
  13. try using:
  14.  
  15.         printf("%ld\n", zahl);
  16.  
  17. use:
  18.  
  19.         %ld     for signed long int
  20.         %lu     for unsigned long int
  21.         %d      for signed int or signed short
  22.         %u      for unsigned int or unsigned short
  23.  
  24.  
  25. ==>Hi Folks!
  26. ==>Got a little problem with printing large int's from a c-program.
  27. ==>Platform: Digital Alpha running DG-UX3.2
  28. ==>
  29. ==>Problem:
  30. ==>..
  31. ==>..
  32. ==>..
  33. ==>
  34. ==>long int zahl;   /* which is e.g. 10000500001 */
  35. ==>printf("%d\n",zahl);      /* gives 1410565409, which is definitly wrong */
  36. ==>..
  37. ==>..
  38. ==>..
  39. ==>
  40. ==>Is that a problem of printf() or DG-UX or is it my problem that I don't know
  41. ==>the right conversion for printf(). Btw, printf("%u",zahl) didn't work either.
  42. ==>Any suggestions?
  43. ==>Thanks alot,
  44. ==>Henrik
  45. ==>---------------------------------------------------------------------
  46. ==>"Woher soll ich wissen, was ich denke, bevor    |Tel.:+49/89/3089598
  47. ==>ich nicht gehoert habe, was ich sage?"          |smail: Destouchesstr.71
  48. ==>IRC: |GOOSE|                                    |       80796 Munich
  49. ==>Systemadministrator am Lehrstuhl A fuer Mechanik|       Germany
  50. ==>---------------------------------------------------------------------
  51. ==>>>>http://www.lam.mw.tu-muenchen.de/mitarb/wist.html<<<
  52. ==>
  53.  
  54.  
  55.  
  56.  
  57.